a_list = [1, 3, 2, 5, -1, -2, 7, -3]

print(sorted(a_list))
print(a_list)
print(sorted(a_list, key=abs, reverse=True))

print(sorted(['bob', 'about', 'Zoo', 'Credit'], key=str.lower))


def by_key(t):
    return t[0]


def by_value(t):
    return t[1]

L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]

print(sorted(L, key=by_value))
print(sorted(L, key=by_key))
